import { ref } from 'vue';

export const captchaCode = ref('');

export const identifyCode = ref('');

const identifyCodes = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'

export const generateCode = () => {
    let code = '';
    for (let i = 0; i < 4; i++) {
        code += identifyCodes[Math.floor(Math.random() * identifyCodes.length)];
    }
    identifyCode.value = code

    captchaCode.value = identifyCode.value.toUpperCase();

};